package com.star.uc.contract.enums;

import com.star.common.core.contract.enums.IEnum;
import com.star.common.kit.enums.EnumValueResolver;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * satoken异常码
 * 如果需要根据code获取desc，请使用
 *
 * @author zhouhengzhe
 * @version 1.0
 * @date 2023/10/19 18:11
 * @see com.star.common.kit.enums.EnumUtils#getByCode(java.lang.Class, java.lang.Object)
 */
@Getter
@AllArgsConstructor
public enum UserErrorEnum implements IEnum<Integer>, EnumValueResolver<UserErrorEnum, Integer> {

    CAPTCHA(10000, "需要人机验证"),
    USERNAME_OR_PASSWORD_NULL(10001, "用户名或者密码为空"),
    USER_NOT_EXIST(10002, "用户不存在"),
    USER_DISABLE(10003, "当前用户被禁用"),
    PHONE_NULL(10004, "手机号码为空"),
    PHONE_CODE_NULL(10005, "国际区号+手机号为空"),
    COUNTRY_CODE_ERROR(10006, "国际区号为空或者不存在"),
    USER_NOT_LOGIN(10007, "用户未登录，不允许自动登录"),
    TOKEN_NOT_EXIST(10008, "token不存在或者过期"),
    EMAIL_INFO_NULL(10009, "邮箱信息不能为空"),
    EMAIL_NULL(10010, "邮箱号码不能为空"),
    EMAIL_CODE_NULL(10011, "邮箱验证码不能为空"),
    EMAIL_PASSWORD_NULL(10012, "邮箱密码不能为空"),
    EMAIL_CODE_ERROR(10013, "邮箱验证码错误"),
    PASSWORD_ERROR(10014, "密码错误"),
    GENERATE_SID_ERROR(10015, "生成sid失败"),
    SID_REQUEST_NULL(10016, "sid请求体不能为空"),
    SID_NULL(10017, "sid不能为空"),
    SID_INVALID(10018, "SID校验失败"),
    IP_LIMIT(10019, "ip注册数量达到限制"),
    GEETEST_ID_KEY_NULL(10020, "极验id和key不能为空"),
    HOUR_SEND_LIMIT(10021, "已超过每小时最大发送限制,请1小时后再发送"),
    EMAIL_TEMPLATE_NOT_CONFIGURED(10022, "邮件模板未配置，如需不要多语言请配置默认的EN(英文)模版"),
    PHONE_INFO_NULL(10024, "手机相关信息不能为空"),
    PHONE_FORMAT_ERROR(10025, "手机号格式有问题"),
    PHONE_VALIDATE_CODE_NULL(10026, "手机号验证码为空"),
    TOKEN_NULL(10027, "token不能为空"),
    VIRTUAL_PHONE_PREFIX(10028, "当前手机号为虚拟手机号，不允许发生短信"),
    HIGH_COST_AREA(10029, "当前手机号为高费用地区，不允许发生短信"),
    THIRD_CONFIG_NOT_EXIST(10030, "三方配置不存在"),
    THIRD_LOGIN_TOKEN_NOT_EXIST(10031, "第三方登录token不存在"),
    FACEBOOK_RETURN_DATE_NULL_ERROR(10032, "facebook返回数据为空"),
    FACEBOOK_VALIDATE_ERROR(10033, "facebook验证失败"),
    FACEBOOK_USER_INFO_NULL(10034, "facebook用户信息为空"),
    GOOGLE_USER_INFO_NULL(10035, "google用户信息为空"),
    APPLE_PUBLIC_ERROR(10036, "获取苹果公钥失败"),
    VALIDATE_APPLE_ID_TOKEN_ERROR(10037, "验证苹果idToken失败"),
    APPLE_USER_INFO_NULL(10038, "苹果用户信息为空"),
    GET_AUTHORIZE_URL_ERROR(10039, "获取授权url失败"),
    GET_THIRD_LOGIN_PARAM_ERROR(10040, "获取三方登录参数失败"),
    PARAM_NULL(10041, "登录参数不能为空"),
    CODE_NULL(10042, "登录Code为空"),
    STATE_NULL(10043, "登录state为空"),
    PAKAGE_NAME(10044, "包名不能为空"),
    SIGN_NAME(10045, "签名不能为空"),
    SCENE_CODE(10046, "方案号不能为空"),
    OS_TYPE(10047, "系统类型不能为空"),
    BUNDLE_ID(10048, "iOS应用ID不能为空"),
    EXPIRE(10049, "iOS应用ID不能为空"),
    SMS_TEMPLATE_CODE(10050, "短信模板Code不能为空"),
    SMS_CODE_EXPIRE(10051, "短信验证码有效期不能为空"),
    ONE_CLICK_PHONE_REQUEST_ERROR(10052, "一键快速登录请求体不能为空"),
    ALIBABA_ONE_CLICK_CONFIG_NULL(10053, "阿里巴巴一键登录配置为空"),;


    private final Integer code;

    private final String desc;
}
